import 'package:flutter/material.dart';

class CardItem extends StatelessWidget {
  final double height;
  final Widget top;
  final Widget center;
  final Widget bottom;

  CardItem({
    Key key,
    this.height,
    this.top,
    this.center,
    this.bottom,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      height: height,
      child: Row(
        mainAxisAlignment: MainAxisAlignment.start,
        children: buildChildren(),
      ),
    );
  }

  buildChildren() {
    List<Widget> children = new List();
    top ?? children.add(top);
    center ?? children.add(Expanded(child: center,));
    bottom ?? children.add(bottom);
    return children;
  }
}
